<div class="gap"></div>
<div class="gap"></div>
<div class="gap"></div>
<section class="form-step1">
    <div class="container">
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <h3 class="panel-title">Update Institution's Contact Details</h3>
                    </div>
                    <div class="panel-body">
                        <div class="col-lg-10">
                            <div class="errorMessage">
                                <?php if (Yii::app()->user->hasFlash('noresult')): ?>

                                    <div class="flash-success">
                                        <?php echo Yii::app()->user->getFlash('noresult'); ?>
                                    </div>

                                <?php endif; ?>
                            </div>



                            <?php
                            $form = $this->beginWidget('GxActiveForm', array(
                                'action' => Yii::app()->createUrl($this->route),
                                'id' => 'searsh_college',
                                'method' => 'POST',
                                'htmlOptions' => array('class' => 'form-horizontal', 'role' => "form"),
                            ));
                            ?>

                            <div class="form-group">
                                <label for="inputEmail3" class="col-sm-4 control-label">Select State<span class="red">*</span> : </label>
                                <div class="col-sm-5">
                                    <?php echo CHtml::dropdownlist('State[id]', '', CHtml::listData(States::model()->findAll(array('order' => 'state_name ASC','group'=>'state_name')), 'id', 'state_name'), array('class' => 'form-control', 'onchange' => 'getCollege()')); ?>
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="inputEmail3" class="col-sm-4 control-label">Select  College<span class="red">*</span> : </label>
                                <div class="col-sm-5">
                                    <?php echo CHtml::dropdownlist('College[id]', '', CHtml::listData(CollegeDetails::model()->findAll(array('order' => 'name_of_institution ASC')), 'id', 'name_of_institution'), array('class' => 'form-control', 'onchange' => 'getcollgeAddress()')); ?>
                                </div>
                            </div>

                            

                            <div class="form-group">
                                <label for="inputEmail3" class="col-sm-4 control-label">&nbsp;</label>
                                <div class="col-sm-5">
                                    <?php echo GxHtml::submitButton(Yii::t('app', 'View/Update Existing Details Of Your Institution'), array('class' => 'read-more pull-left','style'=>'width:100%;')); ?>
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="inputEmail3" class="col-sm-4 control-label">&nbsp;</label>
                                <div class="col-sm-5">

                                    <a class="read-more pull-left" style="width:100%;" href="<?php echo Yii::app()->createUrl('collegeDetails/collgeInfo'); ?>" class="read-more pull-left">I Can not Find any Institution Listed Here</a>
                                </div>
                            </div>

                            <?php $this->endWidget(); ?>

                            <div class="gap"></div>
                            <div class="gap"></div>  

                        </div>

                    </div>
                </div>
            </div>
        </div>

    </div>
</section>
<div class="gap"></div>
<div class="gap"></div>
<div class="gap"></div>
<div class="gap"></div>
<script type="text/javascript" language="javascript">
    $(document).ready(function() {
        getCollege();
    });
    function getCollege() {
        $.ajax({
            url: "<?php echo CController::createUrl('collegeDetails/findCollege') ?>",
            type: "POST",
            data: $("#searsh_college").serialize(),
            success: function(data, textStatus, jqXHR) {
                $("#College_id").html(data);
              //  getcollgeAddress();
            },
        });
    }
    function getcollgeAddress() {
        $.ajax({
            url: "<?php echo CController::createUrl('College/collgeAddress') ?>",
            type: "POST",
            data: $("#searsh_college").serialize(),
            success: function(data, textStatus, jqXHR) {
                $("#collge_address").html(data);
            },
        });
    }
</script>

